﻿using System;

namespace Medicalsystem.MCP.FormDesigner.Property
{
    /// <summary>
    /// 属性设计器交互基类
    /// </summary>
    public abstract class GetProperty : PropertyBase
    {
        /// <summary>
        /// 自定义控件属性基类
        /// </summary>
        /// <param name="Control"></param>
        public GetProperty(System.Windows.Forms.Control control)
        {
            this._control = control;
        }

        /// <summary>
        /// 关联的控件
        /// </summary>
        protected System.Windows.Forms.Control _control;

        /// <summary>
        /// 属性编辑
        /// </summary>
        /// <param name="properyType">属性类型</param>
        /// <param name="propertyName">属性名称</param>
        /// <param name="value">属性值</param>
        /// <returns></returns>
        public virtual object ShowEditor(Type properyType, string propertyName, object value)
        {
            return value;
        }

        /// <summary>
        /// 属性描述符
        /// </summary>
        /// <param name="properyType">属性类型</param>
        /// <param name="propertyName">属性名称</param>
        /// <param name="value"></param>
        /// <returns>属性值</returns>
        public virtual string DescriptorContext(Type properyType, string propertyName, object value)
        {
            return "";
        }
    }
}